package misp_backend.controller;

import misp_backend.config.AjaxResult;
import misp_backend.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/login")
public class LoginController {
    @Autowired
    private UserService sysUserService;
    @GetMapping("/validate")
    public AjaxResult login(@RequestParam String username, @RequestParam String password){
        return AjaxResult.success(sysUserService.validateUser(username, password));
    }
}
